package com.project.service.impl;

import com.project.bean.GradeBean;
import com.project.mapper.IGradeMapper;
import com.project.service.IGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
@Service
public class GradeServiceImpl implements IGradeService {
    @Autowired
    private IGradeMapper gradeMapper;

    /**
     * 查询所有权限
     *
     * @return 权限集合
     */
    @Override
    public List<GradeBean> findALL() {
        return gradeMapper.selectList(null);
    }

    /*-------------------------------------------------------------------------------------------------------*/

    /**
     * 按角色id查询
     *
     * @param roles 角色id
     * @return 权限结合
     */
    @Override
    public Set<GradeBean> findByRoleId(Integer[] roles) {
        return gradeMapper.findByRole(roles);
    }
}
